package cn.edu.sgu.www.pms.dto;

import cn.edu.sgu.www.pms.consts.CustomMessages;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class UserDTO implements Serializable {
    private static final long serialVersionUID = 18L;

    @NotBlank(message = CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "用户ID", required = true)
    private String id;

    /**
     * 姓名
     */
    @NotBlank(message = "姓名" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "姓名", required = true)
    private String name;

    /**
     * 性别
     */
    @NotNull(message = "性别" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "性别", required = true)
    private Integer gender;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "用户名", required = true)
    private String username;

    /**
     * 手机号
     */
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "无效的手机号")
    @ApiModelProperty(value = "手机号", required = true)
    private String phone;

    /**
     * 锁定状态，锁定的账号将无法登录系统。
     * 0-未锁定；1-已锁定
     */
    @NotNull(message = "锁定状态" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "锁定状态", required = true)
    private Integer lockStatus;

    /**
     * 应用ID
     */
    @NotNull(message = "应用" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "应用ID", required = true)
    private Integer serviceId;
}